package com.jhgsys.internal.others.controller;

import com.jhgsys.internal.common.controller.BaseController;
import com.jhgsys.internal.common.controller.FileUploader;
import com.jhgsys.internal.common.entity.FebsResponse;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Slf4j
@RestController
@RequestMapping("imageScan")
public class ImageScanController extends BaseController {

    @GetMapping("/fileUp")
    @RequiresPermissions("imageScan:view")
    FebsResponse fileUp(HttpServletRequest request, HttpServletResponse response, Integer width) {
        String type = request.getParameter("type");
        String path = "ftanews";
        FebsResponse objects = FileUploader.fileUpCommon(request, response, path, width);
        return objects;
    }

}
